<template>
    <h1>子组件</h1>
    <button @click="emit('chuandi' , 100)">
    点击子传父
    </button>
    <button @click="emit('chuanO',{name:'张三',age:18})">传递O</button>
</template>
<script setup>
// defineEmits
const emit = defineEmits(['chuandi','chuanO'])
// const setMsg = ()=>{
//     emit('chuandi' , 100)
// }
</script>
<style>
.box {
    min-height: 200px;
    border: 1px solid #000;
    padding: 20px;
    box-sizing: border-box;
}
</style>